package com.zz.hw;

import java.util.Scanner;

public class Main2 {
    public static void main(String[] args) {
        Scanner i = new Scanner(System.in);
        int n = i.nextInt();
        System.out.println(fun(n));
    }
    public static long fun(int n){
       // 3j+i = n;
       // i =  n -3j;
        long total = 1;//全1为第一种
        //i 为1的次数 , j为3的次数
        for (int i = 0; i < n; i++) {
            int rem = (n-i)%3;
            if(rem == 0){
                int j = (n-i)/3;
                int m = i + j;
                long top = 1;
                for (int k = 0; k < j; k++) {
                    top = top*(m-k);
                }
                long low = 1;
                for (int k = 0; k < j; k++) {
                    low = low * (j-k);
                }
                total = total + top/low;
            }else {
                continue;
            }
        }
        return total;
    }
}
